import { NgModule, Inject } from '@angular/core';
import { SharedModule } from '@shared';
import { ALAIN_I18N_TOKEN } from '@delon/theme';
import { I18NService } from '@core';
import { default as zh_CN } from './_i18n/zh-CN';
import { default as en_US } from './_i18n/en-US';
import { ProductLayoutComponent } from './_layout/layout.component';
import { ProductRoutingModule } from './product-routing.module';
import { ProductViewComponent } from './product-view/product-view.component';
import { ProductSummaryComponent } from './components/summary/product-summary.component';
import { ProductBasicInfoComponent } from './components/basic-info/product-basicInfo.component';
import { ProductPriceComponent } from './components/price/product-price.component';
import { ProductStockComponent } from './components/stock/product-stock.component';
import { ProductInterestComponent } from './components/interest/product-interest.component';
import { ProductListComponent } from './product-list/product-list.component';
import { ProductSearchComponent } from './components/search/product-search.component';
import { ProductCellComponent } from './components/cell/product-cell.component';
import { ProductImageComponent } from './product-image/product-image.component';
import { FileManagerComponent } from './product-image/file-manager/file-manager.component';
import { ProductYearComponent } from './prodyear/product-year.component';
import { ProductYearEditComponent } from './prodyear/edit/product-year-edit.component';
import { ProductSaleDataComponent } from './components/sale/product-sale.component';
import { ProdActualPieComponent } from './components/sale/prod-actual-sale/prod-actual-pie.component';
import { ProdActualBarComponent } from './components/sale/prod-actual-sale/prod-actual-bar.component';
import { ProdSaleWeekLineComponent } from './components/sale/prod-actual-sale/prod-saleweek-line.component';
import { ProdChinaMapComponent } from './components/sale/prod-actual-sale/prod-map.component';
import { ProductRepairComponent } from './components/repair/product-repair.component';
import { RepairMonthSumComponent } from './components/repair/components/repair-month-sum/repair-month-sum.component';
import { RepairChannelPieComponent } from './components/repair/components/repair-channel/repair-channel.component';
import { RepairRateGaugeComponent } from './components/repair/components/repair-rate/repair-rate-gauge.component';
import { RepairChinaComponent } from './components/repair/components/repair-china/repair-china.component';
import { RepairReasonRateComponent } from './components/repair/components/repair-reason/repair-reason-rate.component';
import { RepairReasonPieComponent } from './components/repair/components/repair-reason-pie/repair-reason-pie.component';
import { ProductLensComponent } from './components/repair/product-lens.component';

const COMPONENTS = [
  ProductLayoutComponent,
  ProductViewComponent,
  ProductListComponent,
  ProductImageComponent,
  ProductYearComponent,
  ProdActualPieComponent,
  ProdActualBarComponent,
  ProdSaleWeekLineComponent,
  ProdChinaMapComponent,
  ProductRepairComponent,
  RepairMonthSumComponent,
  RepairChannelPieComponent,
  RepairRateGaugeComponent,
  RepairChinaComponent,
  RepairReasonRateComponent,
  RepairReasonPieComponent,
  ProductLensComponent,
];
const COMPONENTS_NOROUNT = [
  ProductSummaryComponent,
  ProductBasicInfoComponent,
  ProductPriceComponent,
  ProductStockComponent,
  ProductInterestComponent,
  ProductSearchComponent,
  ProductCellComponent,
  FileManagerComponent,
  ProductYearEditComponent,
  ProductSaleDataComponent,
];

@NgModule({
  imports: [SharedModule, ProductRoutingModule],
  declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT],
  entryComponents: COMPONENTS_NOROUNT,
})
export class ProductModule {
  constructor(@Inject(ALAIN_I18N_TOKEN) i18n: I18NService) {
    i18n.load('zh-CN', zh_CN);
    i18n.load('en-US', en_US);
  }
}
